﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
using System.Text;

namespace iTransact.Utils
{
	public static class PayloadSignature
	{
		public static string Generate(string xml, string key)
		{
			var encoding = new UTF8Encoding();
			var signature = new HMACSHA1(encoding.GetBytes(key));
			return Convert.ToBase64String(signature.ComputeHash(encoding.GetBytes((xml.ToCharArray()))));
		}
	}
}
